<taglib name="html"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[系统设置]-[数据库管理]</title>
<load href="__PUBLIC__/Css/admin_style.css"/>
<script>
function switch_en_table(){
  if(document.getElementById('en_field_table').style.display=='none'){
	  document.getElementById('en_field_table').style.display='block';
  }else{
	  document.getElementById('en_field_table').style.display='none';
  }
}
function checkform(){
  if(document.getElementById('en_field').value==''){
	 alert('英文字段不能为空');
	 document.getElementById('en_field').focus();
	 return false; 
  }
  return true;
  document.getElementById('en_field').disabled=true;
}
function switch_remain_table(){
  if(document.getElementById('remain_field_table').style.display=='none'){
	  document.getElementById('remain_field_table').style.display='block';
  }else{
	  document.getElementById('remain_field_table').style.display='none';
  }
}
function checkform2(){
  if(document.getElementById('remain_field').value==''){
	 alert('字段不能为空');
	 document.getElementById('remain_field').focus();
	 return false; 
  }
  return true;
  document.getElementById('remain_field').disabled=true;
}
</script>
</head>

<body>
<a href="__APP__/admin/syscolumn/index">栏目管理</a>&nbsp;|&nbsp;<a href="__URL__/index/table/{$table}">添加字段</a>&nbsp;|&nbsp;
<a href="__URL__/reverse/table/{$table}">反转所有字段顺序</a>
<a href="javascript:void(0);" onClick="switch_en_table()">添加英文字段</a>
<a href="javascript:void(0);" onClick="switch_remain_table()">添加保留原始文件名字段</a>
<table border="0" cellspacing="0" cellpadding="0" style="display:none;" id="en_field_table">
<form name="form_en_field" id="form_en_field" method="post" action="__URL__/add_en_field/table/{$table}" onSubmit="return checkform();">
<tr>
<td>
  <input type="text" name="en_field" id="en_field" value="多个字段，隔开,*代表全部,但执行时间较长，有一定危险性"style="width:500px;height:50px;"/><input type="submit" id="add_en_field" name="add_en_field" value="确认"/></td>
</tr>
</form>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="display:none;" id="remain_field_table">
<form name="form_remain_field" id="form_remain_field" method="post" action="__URL__/add_remain_field/table/{$table}" onSubmit="return checkform2();">
<tr>
<td>
  <input type="text" name="remain_field" id="remain_field" value="多个字段，隔开"style="width:500px;height:50px;"/><input type="submit" id="add_remain_field" name="add_remain_field" value="确认"/></td>
</tr>
</form>
</table>
<hr>
<if condition="empty($field_arr) eq true">对不起，还没有任何字段<else/>
<table border="0" cellspacing="10" cellpadding="0" style="text-align:center">
  <tr>
    <td>字段名称</td>
    <td>字段类型(长度)</td>
    <td>字段描述</td>
    <td>详细页</td>
    <td>list页</td>
    <td>起用状态</td>
    <td>顺序</td>
    <td>操作</td>
  </tr>
  <volist name="field_arr" id="vo">
    <tr>
    <td>{$vo.field_name}</td>
    <td>{$vo.field_type}({$vo.field_length})</td>
    <td>{$vo.field_comment}</td>
    <td><if condition="$vo['field_isdetail'] eq true"><a href="__URL__/setup/type/field_isdetail/table/{$table}/field/{$vo.field_name}">√</a><else/><a href="__URL__/setup/type/field_isdetail/table/{$table}/field/{$vo.field_name}">×</a></if></td>
    <td><if condition="$vo['field_islist'] eq true"><a href="__URL__/setup/type/field_islist/table/{$table}/field/{$vo.field_name}">√</a><else/><a href="__URL__/setup/type/field_islist/table/{$table}/field/{$vo.field_name}">×</a></if></td>
    <td><if condition="$vo['field_isuse'] eq true"><a href="__URL__/setup/type/field_isuse/table/{$table}/field/{$vo.field_name}">√</a><else/><a href="__URL__/setup/type/field_isuse/table/{$table}/field/{$vo.field_name}">×</a></if></td>
     <td><if condition="$vo.sequence lt $maxseq"><a href="__URL__/up/id/{$vo.id}/table/{$table}">↑</a></if>&nbsp;<if condition="$vo.sequence gt $minseq"><a href="__URL__/down/id/{$vo.id}/table/{$table}">↓</a></if></td>
    <td><a href="__URL__/edit/table/{$table}/field/{$vo.field_name}">修改</a>&nbsp;|&nbsp;<a href="__URL__/delete/table/{$table}/field/{$vo.field_name}">删除</a>&nbsp;|&nbsp;<a href="__URL__/copyfield/table/{$table}/field/{$vo.field_name}">复制</a></td>
  </tr>
  </volist>
</table>
</if>
<table border="0" cellspacing="0" cellpadding="5" style="margin-top:20px">
<form name="form1" method="post" action="__URL__/insert/table/{$table}">
  <tr>
    <td colspan="6"><div align="center">新增字段</div></td>
    </tr>
  <tr>
    <td>字段名称：</td>
    <td><input type="text" name="field_name" id="field_name"></td>
    <td>字段类型：</td>
    <td>
    <html:select options="field_type" id="field_type" name="field_type"/>     </td>
    <td>字段长度：</td>
    <td><input type="text" name="field_length" id="field_length"></td>
  </tr>
  <tr>
    <td>字段描述(数据库，表单标签)：</td>
    <td><input type="text" name="field_comment" id="field_comment"></td>
    <td>输出框：</td>
    <td>
    <html:select options="field_output_type" id="field_output_type" name="field_output_type"/>
    </select>    </td>
    <td>输出框长度：</td>
    <td><input type="text" name="field_output_length" id="field_output_length"></td>
  </tr>
  <tr>
    <td>注意事项(表单右侧)：</td>
    <td><input type="text" name="field_notice" id="field_notice"></td>
    <td>字段填充类型：</td>
    <td>
    <html:select options="field_value_fill_type" id="field_value_fill_type" name="field_value_fill_type"/>  </td>
    <td>字段填充：</td>
    <td><input type="text" name="field_value_fill" id="field_value_fill"></td>
  </tr>
  <tr>
    <td>字段默认值：</td>
    <td><input type="text" name="field_default_value" id="field_default_value"></td>
    <td colspan="4">是否起用：
      <input name="field_isuse" type="checkbox" id="field_isuse" value="1"> 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 是否详细：
      <input name="field_isdetail" type="checkbox" id="field_isdetail" value="1"> 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 是否list：
      <input name="field_islist" type="checkbox" id="field_islist" value="1"></td>
    </tr>
    <tr >
    <td>所属分组：</td>
    <td><html:select options="sg_list" id="field_group_id" name="field_group_id"/></td>
    <td colspan="4">显示字数：
      <input type="text" name="field_index_size" id="field_index_size">
      index页面使用
   </td>
    </tr>
    <tr>
    <td colspan="6">是否要生成缩略图：
      
      <input type="checkbox" name="is_thumb" id="is_thumb" value="1">缩略图宽度：
      <input name="thumb_w" type="text" id="thumb_w" size="10">
      缩略图高度：
      <input name="thumb_h" type="text" id="thumb_h" size="10">
      缩略图标志：
      <input name="thumb_label" type="text" id="thumb_label" size="10">
      类型：
      <html:select options="thumb_type" id="thumb_type" name="thumb_type"/>
      </td>
    </tr>
    <tr>
    <td colspan="6">是否要打水印：
      <input type="checkbox" name="is_wm" id="is_wm" value="1">
      水印类型：
  <html:select options="wm_type" id="wm_type" name="wm_type"/>
      水印位置：
  <html:select options="wm_pos" id="wm_pos" name="wm_pos"/>
      </td>
    </tr>
  <tr>
    <td colspan="6"><div align="center">
      <input type="submit" name="button" id="button" value="添  加"  onClick="submit();this.disabled=true">
      <input type="reset" name="button2" id="button2" value="返  回">
    </div></td>
    </tr>
  </form>
</table>

</body>
</html>
